import ast

class ReprAble:
    __repr_keys__ = []
    __repr_exclude_keys__ = []

    def __repr__(self):
        data = self.__dict__
        if self.__repr_keys__:
            data = {k: v for k, v in data.items() if k in self.__repr_keys__}
        if self.__repr_exclude_keys__:
            data = {k: v for k, v in data.items() if k not in self.__repr_exclude_keys__}
        return '%s' % (data)

    def to_dict(self):
        obj = ast.literal_eval(self.__repr__())
        return obj